<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>LingPipe: Echo Demo</title>
<meta http-equiv="Content-type" 
      content="application/xhtml+xml; charset=utf-8"/>
<meta http-equiv="Content-Language" 
      content="en"/>
<link href="css/lp-site.css" 
      type="text/css" 
      rel="stylesheet"
      title="lp-site"
      media="screen,projection,tv"/>

<link href="css/lp-site-print.css" 
      title="lp-site" 
      type="text/css" 
      rel="stylesheet" 
      media="print,handheld,tty,aural,braille,embossed"/>

</head>

<body>

<div id="header">
<h1 id="product">LingPipe</h1>
<h1 id="pagetitle">Echo Demo</h1>
<a id="logo" 
   href="http://alias-i.com/"
  ><img src="img/logo-small.gif" alt="alias-i logo"/>
</a>
</div><!-- head -->


<div id="navig">

<!-- set class="current" for current link -->
<ul>
<li><a href="../index.html">home</a></li>

<li>
  <a class="current" href="demos.html">demos</a>
  <ul>
    <li>
      demo instructions
      <ul>
        <li><a href="demo-web.html">web</a></li>
        <li><a href="demo-gui.html">gui</a></li>
        <li><a href="demo-cmd.html">command line</a></li>
      </ul>
    </li>
    <li>
      list of demos
      <ul>
        <li><a href="demo-sentence.html">sentences</a></li>
        <li><a href="demo-pos.html">parts of speech</a></li>
        <li><a href="demo-ne.html">named entities</a></li>
        <li><a href="demo-coref.html">coreference</a></li>
        <li><a href="demo-chinese-words.html">chinese words</a></li>
        <li><a class="current" href="demo-echo.html">echo &amp; transcoding</a></li>
      </ul>
    </li>
  </ul>
</li>

<li><a href="licensing.html">license</a></li>

<li>download
<ul>
<li><a href="download.html">lingpipe core</a></li>
<li><a href="models.html">models</a></li>
</ul>
</li>

<li>docs
<ul>
<li><a href="install.html">install</a></li>
<li><a href="../demos/tutorial/read-me.html">tutorials</a></li>
<li><a href="../docs/api/index.html">javadoc</a></li>
<li><a href="book.html">textbook</a></li>
</ul>
</li>

<li>community
<ul>
<li><a href="customers.html">customers</a></li>
<li><a href="http://groups.yahoo.com/group/LingPipe/">newsgroup</a></li>
<li><a href="http://lingpipe-blog.com/">blog</a></li>
<li><a href="bugs.html">bugs</a></li>
<li><a href="sandbox.html">sandbox</a></li>
<li><a href="competition.html">competition</a></li>
<li><a href="citations.html">citations</a></li>
</ul>
</li>

<li><a href="contact.html">contact</a></li>

<li><a href="about.html">about alias-i</a></li>
</ul>

<div class="search">
<form action="http://www.google.com/search">
<p>
<input type="hidden" name="hl" value="en" />
<input type="hidden" name="ie" value="UTF-8" />
<input type="hidden" name="oe" value="UTF-8" />
<input type="hidden" name="sitesearch" value="alias-i.com" />
<input class="query" size="10%" name="q" value="" />
<br />
<input class="submit" type="submit" value="search" name="submit" />
<span style="font-size:.6em; color:#888">by&nbsp;Google</span>
</p>
</form>
</div>

</div><!-- navig -->


<div id="content" class="content">

<h2>About the Echo Demo</h2>

<div class="sidebar">
<h2>Echo Demo Implementation</h2>
<p>
The echo demo's implementation is in:
</p>
<ul><li>
<a href="../demos/generic/src/com/aliasi/demo/demos/EchoDemo.java"><code>demo/demos/EchoDemo.java</code></a>
</li></ul>
<p>
Like every demo, this implements:
</p>
<ul><li>
<a href="../demos/generic/src/com/aliasi/demo/framework/StreamDemo.java"><code>demo/framework/StreamDemo.java</code></a>
</li></ul>
<p>
The demos and framework are in:
</p>
<ul><li>
<code>$lingpipe/demos/generic</code>
</li></ul>
</div>

<p>
The echo demo merely returns the text it is given.  Even though
this is the simplest possible implementation of LingPipe's demo
framework, it is useful because of features built into
the general framework.
</p>

<h3>Character Transcoding</h3> 

<p>Because the input and output
character sets may be specified, the echo demo may be used to convert one
character set to another.  
</p>

<h3>HTML Normalization</h3> 

<p>
Because any input HTML is normalized into valid XHTML by the NekoHTML
parser, the echo demo may be used to normalize HTML to XHTML.
</p>

<h2>Echo Demo on the Web</h2>

<p>
The echo demo is hosted on the web at the following URL:
</p>

<pre class="code">
<a href="http://lingpipe-demos.com:8080/lingpipe-demos/echo/textInput.html"><code>http://lingpipe-demos.com:8080/lingpipe-demos/echo/textInput.html</code></a>
</pre>

<p>
For detailed information about using web demos, including web form,
file upload and web service instructions, see the <a
href="demo-web.html">web demo instructions</a>
</p>

<h2>Echo Demo via GUI</h2>

<p>
To launch the echo demo in a GUI, first change directories to the
command directory and then invoke the demo batch script. <em>Note:</em> Parameters are set in the GUI, not as arguments to the launch script.
</p>

<h3>Windows Operating System</h3>
<pre class="code">
&gt; cd %LINGPIPE_HOME%\demos\generic\bin
&gt; gui_echo.bat 
</pre>

<h3>Unix-like Operating Systems</h3>
<pre class="code">
&gt; cd $LINGPIPE_HOME/demos/generic/bin
&gt; sh gui_echo.sh
</pre>

<p>
For detailed information about running demos in a GUI,
see the <a href="demo-gui.html">GUI demo instructions</a>
</p>

<h2>Echo Demo via Shell Command</h2>

<p>Shell commands may be run over single files, all of the files
in a directory, or using standard input/output.  
</p>

<h3>Running over a Directory</h3>
<pre class="code">
&gt; cd $LINGPIPE/demos/generic/bin
&gt; cmd_echo.bat -inDir=../../data/testdir -outDir=/testout
</pre>

<h3>Running a Single File</h3>
<pre class="code">
&gt; cd $LINGPIPE/demos/generic/bin
&gt; cmd_echo.bat -inFile=../../data/testdir/foo.txt -outFile=foo.out.xml
</pre>


<h3>Running through a Pipe (Standard input/output)</h3>
<pre class="code">
&gt; cd demos/generic/bin
&gt; echo See Spot. See Spot run. | cmd_echo.bat
</pre>

<h3>Running in Unix-like Operating Systems</h3>
<p>
For unix-like operating systems such as Unix,
Solaris, Linux, or Macintosh OS X:
</p>
<ul>
<li>Replace path backward slashes
(<code>\</code>) with forward slashes (<code>/</code>), and
</li>
<li>substitute <code>.sh</code>
for the <code>.bat</code> suffix in the command.
</li>
</ul>




<p>
For detailed information about running demos from the command line,
see the <a href="demo-cmd.html">command line demo instructions</a>
</p>


<h2>Echo Demo Scripts</h2>

<p>
The following scripts are available in
<code>$LINGIPE/demos/generic/bin</code> for running the demo.  Note
that each script comes in four flavors, distinguishing
command line from GUI, and the Windows DOS shell from the Unix shell.
</p>

<table class="demolist">
<tr><th>Language</th>
    <th>Genre</th>
    <th>Mode</th>
    <th>Windows DOS</th>
    <th>Unix/Linux/Mac sh</th></tr>
<tr><td colspan="2" rowspan="2">Universal</td>
    <td>Command</td>
    <td><a href="../demos/generic/bin/cmd_echo.bat"><code>cmd_echo.bat</code></a></td>
    <td><a href="../demos/generic/bin/cmd_echo.bat"><code>cmd_echo.sh</code></a></td>
</tr>
<tr>
    <td>GUI</td>
    <td><a href="../demos/generic/bin/gui_echo.bat"><code>gui_echo.bat</code></a></td>
    <td><a href="../demos/generic/bin/gui_echo.bat"><code>gui_echo.sh</code></a></td>
</tr>
</table>

<h2>Echo Demo Parameters</h2>

<p>
The following is a complete list of parameters for the demo.  
</p>

<h3>General Demo Parameters</h3>

<p>
These parameters apply to every version (web/GUI/command) of every demo.
</p>

<table>
<tr><th>Parameter</th>
    <th>Description</th>
    <th>Usage Constraints</th></tr>
<tr><td><code>inCharset</code></td>
    <td>Input character set</td>
    <td rowspan="2">Optional.  Defaults to platform default.</td></tr>
<tr><td><code>outCharset</code></td>
    <td>Output character set</td></tr>
<tr><td><code>contentType</code></td>
    <td>Input content type</td>
    <td>May be one of:
       <ul><li><code>text/plain</code></li> 
           <li><code>text/html</code></li>
           <li><code>text/xml</code></li>
       </ul>
       Defaults to <code>text/plain</code>.</td></tr>
<tr><td><code>removeElts</code></td>
    <td>Element tags to remove</td>
    <td rowspan="3">Optional. May only be used with <code>contentType=text/html</code>
        or <code>contentType=text/xml</code>.  Each value may be
        comma-separated list.  If neither of these are
        specified, all text content is processed.</td></tr>
<tr><td><code>includeElts</code></td>
    <td>Elements to annotate</td></tr>
</table>

<h3>Command-Line Only Parameters</h3>

<p>
These parameters apply to every command-line demo, but are not
relevant for the GUI or web versions of the demos.
</p>


<table>
<tr><th>Parameter</th>
    <th>Description</th>
    <th>Usage Constraints</th></tr>
<tr><td><code>inFile</code></td>
    <td>Readable input file</td>
    <td rowspan="2">May not be used with <code>inDir</code>. 
                    If either is not specified, defaults to standard input or output.</td>
    </tr>
<tr><td><code>outFile</code></td>
    <td>Writeable output file</td>
    </tr>
<tr><td colspan="3" class="separator"></td></tr>
<tr><td><code>inDir</code></td>
    <td>Readable input directory</td>
    <td rowspan="2">May not be used with <code>inFile</code> or <code>outFile</code>.
        If used, <code>inDir</code> and <code>outDir</code> must both be specified.</td></tr>
<tr><td><code>outDir</code></td>
    <td>Writeable output directory</td></tr>
</table>

</div><!-- content -->

<div id="foot">
<p>
&#169; 2003&ndash;2011 &nbsp;
<a href="mailto:lingpipe@alias-i.com">alias-i</a>
</p>
</div>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-15123726-1");
pageTracker._trackPageview();
} catch(err) {}</script></body>
</html>


